/*
Copyright (C) 2022-2024 Inspur Corp. All Rights Reserved.

SPDX-License-Identifier: Apache-2.0
*/
package router

import (
	"did-service/auth"
	"did-service/controller"
	"did-service/router/wsreg"

	"github.com/emicklei/go-restful"
)

func Route(container *restful.Container, controller *controller.DidController) {
	wsUnlogin := new(restful.WebService)
	wsreg.RegisterUnLoginWebService(wsUnlogin, controller)
	container.Add(wsUnlogin)

	wsApi := new(restful.WebService)
	wsreg.RegisterApiWebService(wsApi, controller)
	container.Add(wsApi)

	ws := new(restful.WebService)
	ws.Filter(auth.AuthFilter)
	wsreg.RegisterWalletWebService(ws, controller)
	wsreg.RegisterUserManageWebService(ws, controller)
	wsreg.RegisterDidWebService(ws, controller)
	wsreg.RegisterDidManageWebService(ws, controller)
	wsreg.RegisterIssuerWebService(ws, controller)
	wsreg.RegisterCPTWebService(ws, controller)
	wsreg.RegisterIdentityHubWebService(ws, controller)
	wsreg.RegisterCredentialWebService(ws, controller)
	wsreg.RegisterPresentationWebService(ws, controller)
	wsreg.RegisterMenuWebService(ws, controller)
	container.Add(ws)
}
